package com.fr.report.io;

import com.fr.base.StringUtils;
import com.fr.base.xml.XMLPrintWriter;
import com.fr.base.xml.XMLReadable;
import com.fr.base.xml.XMLableReader;
import com.fr.report.io.xml.ReportXMLUtils;
import java.io.Serializable;

public class ExcelExportAttr
  implements XMLReadable, Cloneable, Serializable
{
  private boolean isExportHidedRow = true;
  private boolean isExportHidedColumn = true;
  private String password = null;
  private String protectedWord = null;

  public boolean isExportHidedRow()
  {
    return this.isExportHidedRow;
  }

  public void setExportHidedRow(boolean paramBoolean)
  {
    this.isExportHidedRow = paramBoolean;
  }

  public boolean isExportHidedColumn()
  {
    return this.isExportHidedColumn;
  }

  public void setExportHidedColumn(boolean paramBoolean)
  {
    this.isExportHidedColumn = paramBoolean;
  }

  public String getPassword()
  {
    return this.password;
  }

  public void setPassword(String paramString)
  {
    this.password = paramString;
  }

  public void writeXML(XMLPrintWriter paramXMLPrintWriter)
  {
    paramXMLPrintWriter.startTAG("ExcelExportAttr");
    if (!(isExportHidedColumn()))
      paramXMLPrintWriter.attr("hideColumn", this.isExportHidedColumn);
    if (!(isExportHidedRow()))
      paramXMLPrintWriter.attr("hideRow", this.isExportHidedRow);
    if (StringUtils.isNotBlank(getPassword()))
      paramXMLPrintWriter.attr("pwd", ReportXMLUtils.passwordString(this.password));
    if (StringUtils.isNotBlank(getProtectedWord()))
      paramXMLPrintWriter.attr("protectedWord", ReportXMLUtils.passwordString(getProtectedWord()));
    paramXMLPrintWriter.end();
  }

  public void readXML(XMLableReader paramXMLableReader)
  {
    String str1 = null;
    if (paramXMLableReader.isAttr())
    {
      if ((str1 = paramXMLableReader.getAttr("hideRow")) != null)
        setExportHidedRow(Boolean.valueOf(str1).booleanValue());
      if ((str1 = paramXMLableReader.getAttr("hideColumn")) != null)
        setExportHidedColumn(Boolean.valueOf(str1).booleanValue());
      if ((str1 = paramXMLableReader.getAttr("pwd")) != null)
        setPassword(ReportXMLUtils.unPasswordString(str1));
      if ((str1 = paramXMLableReader.getAttr("protectedWord")) != null)
        setProtectedWord(ReportXMLUtils.unPasswordString(str1));
    }
    if (paramXMLableReader.isChildNode())
    {
      String str2 = paramXMLableReader.getTagName();
      if ("ExportHidedRow".equals(str2))
        if ((str1 = paramXMLableReader.getElementValue()) != null)
          setExportHidedRow(Boolean.valueOf(str1).booleanValue());
      else if ("ExportHidedColumn".equals(str2))
        if ((str1 = paramXMLableReader.getElementValue()) != null)
          setExportHidedColumn(Boolean.valueOf(str1).booleanValue());
    }
  }

  public Object clone()
    throws CloneNotSupportedException
  {
    ExcelExportAttr localExcelExportAttr = (ExcelExportAttr)super.clone();
    localExcelExportAttr.setExportHidedColumn(isExportHidedColumn());
    localExcelExportAttr.setExportHidedRow(isExportHidedRow());
    return localExcelExportAttr;
  }

  public String getProtectedWord()
  {
    return this.protectedWord;
  }

  public void setProtectedWord(String paramString)
  {
    this.protectedWord = paramString;
  }
}